1 using System;
2 using
UnityEngine;
3 using
UnityEngine.SceneManagement;
4 using
UnityStandardAssets.CrossPlatformInput;
5
6 [RequireComponent(
typeof (GUITexture))]
7 public
class ForcedReset : MonoBehaviour
8 {
9     
private void Update()
10     {
11         
// if we have forced a reset ...
12         
if (CrossPlatformInputManager.GetButtonDown("ResetObject"))
13         {
14             
//... reload the scene
15             SceneManager.LoadScene(SceneManager.GetSceneAt(
0).path);
16         }
17     }
18 }


Gõ tìm kiếm nhanh...